#ifndef SHIP_H_
#define SHIP_H_

#include "../WidgetMovimiento.h"
#include "../Event.h"
#include "ShipStatus.h"
#include "../Timer.h"
#include "UserInfo.h"

class Ship: public WidgetMovimiento {

private:
	std::string owner;
	std::string imagePath;
	float rotationVelocity;
	int maximumVelocity;
	int propulsion;
	int friction;
	int bulletLifeTime;
	int life;
	float velX;
	float velY;

	bool goingForward;
	bool turningLeft;
	bool turningRight;
	bool shooting;
	bool keyPressed;

	Timer timer;

	SDL_Surface* shipSurface;
	SDL_Surface* combustionShipSurface;

	UserInfo* userInfo;

	void loadSurfaceImageFiles();
	void initUserInfo();

public:

	Ship(ShipStatus* shipStatus,Widget* parent);

	virtual void handleEvent(Event event);

	virtual void resolve();

	virtual void showOn(SDL_Surface* surface);

	ShipStatus getShipStatus();

	void updateStatus(ShipStatus* toUse);

	std::string getOwner();

	int getBulletX();
	int getBulletY();
	int getBulletAngle();
	bool isShooting();

	bool duenoesinstancialocal;
    int getBulletDuration() const;

	int getBulletLifeTime();

	virtual ~Ship();
};

#endif /* Ship_H_ */
